﻿namespace PMS.Data.Entities.Stores
{
    /// <summary>
    /// Represents a store
    /// </summary>
    public partial class Store : BaseEntity
    {
        private string _url;
        /// <summary>
        /// Gets or sets the store name
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the store URL
        /// </summary>
        public string Url {
            get
            {
                if (!string.IsNullOrEmpty(_url))
                    if (!_url.EndsWith('/'))
                        _url = _url + "/";
                return _url;
            }
            set => _url = value;
        }

        /// <summary>
        /// Gets or sets a value indicating whether SSL is enabled
        /// </summary>
        public bool SslEnabled { get; set; }

        /// <summary>
        /// Gets or sets the comma separated list of possible HTTP_HOST values
        /// </summary>
        public string Hosts { get; set; }

        /// <summary>
        /// Gets or sets the identifier of the default language for this store; 0 is set when we use the default language display order
        /// </summary>
        public int DefaultLanguageId { get; set; }

        /// <summary>
        /// 所在时区Id
        /// 可空，设置店铺所在区域的时区，如果为空则设置为当前系统所处的时区进行时间转化
        /// </summary>
        public string TimeZoneId { get; set; }

        /// <summary>
        /// Gets or sets the display order
        /// </summary>
        public int DisplayOrder { get; set; }

        /// <summary>
        /// Gets or sets the company name
        /// </summary>
        public string CompanyName { get; set; }

        /// <summary>
        /// Gets or sets the company address
        /// </summary>
        public string CompanyAddress { get; set; }

        /// <summary>
        /// Gets or sets the store phone number
        /// </summary>
        public string CompanyPhoneNumber { get; set; }

        /// <summary>
        /// IsAcitve: true: 店铺正常
        ///           false:店铺关闭, 禁止访问
        /// </summary>
        //public bool IsActive { get; set; }
        //public DateTime CreatedOnTimeUtc { get; set; }
        //public DateTime UpdatedOnTimeUtc { get; set; }
    }
}
